---
title: removeEmptyContainers
svgo:
  pluginId: removeEmptyContainers
  defaultPlugin: true
---

Remove container elements in the document that have no children or meaningful attributes, excluding the `<svg>` element which is ignored.

A container, as defined in the [SVG specifications](https://www.w3.org/TR/SVG11/intro.html#TermContainerElement), is an SVG element that can have graphical child elements. Container elements include:

- [`<a>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/a)
- [`<defs>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs)
- [`<glyph>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/glyph)
- [`<g>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g)
- [`<marker>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/marker)
- [`<mask>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/mask)
- [`<missing-glyph>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/missing-glyph)
- [`<pattern>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/pattern)
- [`<svg>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg)
- [`<switch>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/switch)
- [`<symbol>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol)
